home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Explorer Yardimcilari / PiXCL Tools / Checkvga.px_ / Checkvga.px
Encoding:
PiXCL source  |  1996-02-02  |  4.9 KB  |  200 lines

  1. {-----------------------------------------------------------------------
  2.     Filename    : checkVGA.pxl
  3.     Purpose        : Check current Windows driver parameters
  4.     Date        : v1.0 06 may 94
  5.     Author        : S.Dibbs, VYSOR Integration Inc
  6.  
  7. ------------------------------------------------------------------------}
  8.  
  9. Initialize:
  10. { Get the screen parameters and adjust the main window for a fixed size. }
  11.  
  12.     Set NewCaption$ = "Verify Windows Data"
  13.     UseCoordinates(METRIC)    
  14.     WinGetActive(OldCaption$)
  15.     WinTitle(OldCaption$,NewCaption$) 
  16.     WinLocate(NewCaption$,1,1,280,210, Res)  
  17.     UseBackground(TRANSPARENT,0,0,80) {Black}
  18.     DrawBackground
  19.     
  20. Restart:
  21.     GetScreenCaps(HORZRES, X_res)
  22.     GetScreenCaps(VERTRES, Y_res)
  23.     GetScreenCaps(HORZSIZE, X_size)
  24.     GetScreenCaps(VERTSIZE, Y_size)
  25.     GetScreenCaps(NUMCOLORS,Colours)
  26.     GetScreenCaps(BITSPIXEL,BitsPerPixel)
  27.     GetScreenCaps(PLANES,BitPlanes)
  28.     
  29.     WaitInput(100)
  30.     SetMenu("Exit!",Run_Leave,
  31.         ENDPOPUP,
  32.         " ",VGA,
  33.         ENDPOPUP,
  34.         "  ",SVGA,
  35.         ENDPOPUP,
  36.         "   ",WKS,
  37.         ENDPOPUP,
  38.         "Vert",IGNORE,
  39.         "Red",Red,
  40.         "Green",Green,
  41.         "Blue",Blue,
  42.         "Restart",Restart,
  43.         ENDPOPUP,
  44.         "Diag",Diag,
  45.         ENDPOPUP,
  46.         "About",About,
  47.         ENDPOPUP)
  48.  
  49. Display:
  50.     Str(X_Res,X_Res$)
  51.     Str(Y_Res,Y_Res$)
  52.     Str(X_Size,X_Size$)
  53.     Str(Y_Size,Y_Size$)
  54.     Str(Colours,Colours$)
  55.     Str(BitsPerPixel,BitsPerPixel$)
  56.     Str(BitPlanes,BitPlanes$)
  57.  
  58.     Set Line1$ = "Screen Resolution is " + X_Res$
  59.     Set Line1$ = Line1$ + " x "
  60.     Set Line1$ = Line1$ + Y_Res$
  61.     Set Line1$ = Line1$ + " pixels"
  62.  
  63.     Set Line2$ = "Screen Size is " + X_Size$
  64.     Set Line2$ = Line2$ + " x "
  65.     Set Line2$ = Line2$ + Y_Size$
  66.     Set Line2$ = Line2$ + " millimeters"
  67.  
  68.     Set Line3$ = "Static Number of colours is " + Colours$
  69.  
  70.     Set Line4$ = "Bits per pixel  is " + BitsPerPixel$
  71.  
  72.     Set Line5$ = "Number of Bitplanes is " +  BitPlanes$
  73.  
  74.     UseFont("Arial",5,10,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  75.     DrawText(20,20,Line1$)
  76.     DrawText(20,30,Line2$)
  77.     DrawText(20,40,Line3$)
  78.     DrawText(20,50,Line4$)
  79.     DrawText(20,60,Line5$)
  80.  
  81.     UseFont("Arial",4,8,BOLD,NOITALIC,NOUNDERLINE,255,255,0)
  82.     If X_Res = 640 Then  Set Line1$ = "Hence, your monitor is VGA compatible, and"
  83.     If X_Res = 800 Then  Set Line1$ = "Hence, your monitor is SVGA compatible, and"
  84.     If X_Res = 1024 Then  Set Line1$ = "Hence, your monitor is XGA compatible, and"
  85.     If X_Res > 1024 Then  Set Line1$ = "Hence, you have a high end PC, and "
  86.  
  87.     If Colours < 20 Then Set Line2$ = "you have an older PC or early model colour Laptop."
  88.     If Colours = 20 Then Set Line2$ = "the number of available dynamic colours is 236."
  89.     If Colours > 20 Then Set Line2$ = "you are probably running a hi-colour or 24 bit video card."
  90.  
  91.     Set Line3$ = "Number of Bitplanes is " +  BitPlanes$
  92.  
  93.     DrawText(30,80,Line1$)
  94.     DrawText(30,90,Line2$)
  95.  
  96.     If  X_Res >= 1024 Then Goto Done
  97.         Set Line3$ = "Concept! programs display best at higher"
  98.         Set Line4$ = "resolutions. Please check if your video card"
  99.         Set Line5$ = "and monitor supports either 800x600 or"
  100.         Set Line6$ = "1024x768x256 colours. Setup this mode."
  101.         DrawText(25,100,Line3$)
  102.         DrawText(25,110,Line4$)
  103.         DrawText(25,120,Line5$)
  104.         DrawText(25,130,Line6$)
  105.     {endif}
  106. Done:
  107.  
  108. Wait_for_input:
  109.     WaitInput()
  110.  
  111.  
  112.  
  113. VGA:
  114.     Set X_Res = 640    
  115.     Set Y_Res = 480     
  116.     DrawBackground    Goto Display
  117. SVGA:
  118.     Set X_Res = 800    
  119.     Set Y_Res = 600     
  120.     DrawBackground    Goto Display
  121. WKS:
  122.     Set X_Res = 1280
  123.     Set Y_Res = 1024    
  124.     Set Colours = 4096    
  125.     DrawBackground    Goto Display
  126.  
  127.  
  128.  
  129. Red:
  130.     UsePen(SOLID,1,255,0,0)
  131.     Goto Vertical 
  132. Green:
  133.     UsePen(SOLID,1,0,255,0)
  134.     Goto Vertical 
  135. Blue:
  136.     UsePen(SOLID,1,0,0,255)
  137. Vertical:
  138.     GoSub Vertical_Drape
  139.     Goto Wait_for_input
  140.  
  141. Diag:
  142.     GoSub Diag_Drape
  143.     Goto Wait_for_input
  144.  
  145. Run_Leave:
  146.     End
  147.  
  148.  
  149. About:
  150.     MessageBox(OK,1,INFORMATION,
  151. "Windows 3.1 application written and 
  152. copyright ⌐ (1994) by 
  153.     VYSOR Integration Inc.
  154. Some portions copyright ⌐ (1992-1994)
  155.     Leblond Group.
  156. All Rights Reserved.",
  157.     "About Check VGA",Res)
  158.     Goto Wait_for_Input
  159.  
  160. {======================================================================}
  161. {Subroutine: }
  162. Vertical_Drape:
  163.     UseCoordinates(PIXEL) 
  164.     Set X1 = 511     Set X2 = 512    Set X3 = 255    Set X4 = 768
  165.     Set Y1 = 1  Set Y2 = 768
  166. Loop1:
  167.     DrawLine(X1,1,X1,768)
  168.     DrawLine(X2,1,X2,768)
  169.     DrawLine(X3,1,X3,768)
  170.     DrawLine(X4,1,X4,768)
  171.     If X3 = 0 Then Set X3 = 1
  172.     Set X1 = X1 - 1     Set X2 = X2 + 1
  173.     Set X3 = X3 - 1     Set X4 = X4 + 1
  174.     If X1 > 255 Then Goto Loop1
  175.     UseCoordinates(METRIC) 
  176.  
  177.     Return
  178.  
  179. {Subroutine: }
  180. Diag_Drape:
  181.     UsePen(SOLID,1,0,128,0)
  182.     UseCoordinates(PIXEL) 
  183.     Set X1 = 522     Set X2 = 777    Set X3 = 256    Set X4 = 511
  184. Loop2:
  185.     DrawLine(X1,1,X2,768)
  186.     DrawLine(X3,1,X4,768)
  187.     Set X1 = X1 + 1     Set X2 = X2 + 1
  188.     Set X3 = X3 + 1     Set X4 = X4 + 1
  189.     If X1 < 768 Then Goto Loop2
  190.  
  191.     Set X1 = 1     Set X2 = 255    
  192. Loop3:
  193.     DrawLine(X1,1,X2,768)
  194.     Set X1 = X1 + 1     Set X2 = X2 + 1
  195.     If X1 < 250 Then Goto Loop3
  196.  
  197.     UseCoordinates(METRIC) 
  198.  
  199.     Return
  200.